package com.meilai.project.controller.web.adMake.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.controller.web.adMake.entity.BillAdMakeDeliver;
import com.meilai.project.controller.web.adMake.mapper.BillAdMakeDeliverMapper;
import com.meilai.project.controller.web.adMake.vo.BillAdMakeDeliverVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 制作单-配送 服务实现类
 * </p>
 *
 * @author 张驰
 * @since 2022-08-16
 */
@Service
public class BillAdMakeDeliverServiceImpl extends ServiceImpl<BillAdMakeDeliverMapper, BillAdMakeDeliver> implements BillAdMakeDeliverService {
    @Transactional
    @Override
    public void deleteByAdMakeId(Long adMakeId) {
        LambdaQueryWrapper<BillAdMakeDeliver> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillAdMakeDeliver::getBill_ad_make_id, adMakeId);
        remove(wrapper);
    }

    @Override
    public List<BillAdMakeDeliverVO> deliverVOListByAdMakeId(Long adMakeId) {
        return baseMapper.deliverVOListByAdMakeId(adMakeId);
    }

    @Override
    public List<BillAdMakeDeliverVO> deliverVOListByAdMakeIdAndSupplierIds(Long adMakeId, List<Long> supplierIds) {
        return baseMapper.deliverVOListByAdMakeIdAndSupplierIds(adMakeId, supplierIds);
    }
}
